package com.prs.crm.domain.document.report;

import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Cascade;

import com.prs.crm.domain.Attachment;
import com.prs.crm.domain.BaseEntity;
/**
 * 	
 * @author Yanghao
 * 2012-6-5 9:38:38 报表中心
 */
@Entity
	@Table(name="report_reportformcenter")
public class ReportFormCenter  extends BaseEntity{
		
		private static final long serialVersionUID = 1L;
		@Id
		@GeneratedValue(strategy=GenerationType.IDENTITY)
		private Integer id;
		private String name;
		private String remark;
		private String updatePermission;//修改权限
		private String visitPermission;//访问权限
		private String updateSet;//更新设置
		
		
		private String updatePerson;//修改人员
		private String jspPath;//jsp路径
		
		private String appiontPerson;//指定人员
		private String appiontPersonId;//指定人员Id
		@ManyToOne(fetch=FetchType.LAZY)
		@Cascade({org.hibernate.annotations.CascadeType.ALL,org.hibernate.annotations.CascadeType.DELETE_ORPHAN})
		private Attachment attach; 
		
		@ManyToOne(fetch=FetchType.LAZY)
		@Cascade({org.hibernate.annotations.CascadeType.ALL,org.hibernate.annotations.CascadeType.DELETE_ORPHAN})
		private Attachment attach1;

		@ManyToOne(cascade=CascadeType.ALL)
		private ReportFormCenter parent;
		
		@OneToMany(mappedBy="parent",cascade=CascadeType.ALL)
		@Cascade({org.hibernate.annotations.CascadeType.ALL,org.hibernate.annotations.CascadeType.DELETE_ORPHAN})
		private Set<ReportFormCenter> childs;
		
		/**
		 * 1，可以修改 2不能修改
		 */
		private Integer upState;
		/**
		 * 1，为显示   2，不显示
		 */
		private Integer viState;
		
		public String getAppiontPersonId() {
			return appiontPersonId;
		}

		public void setAppiontPersonId(String appiontPersonId) {
			this.appiontPersonId = appiontPersonId;
		}

		public Integer getUpState() {
			return upState;
		}

		public void setUpState(Integer upState) {
			this.upState = upState;
		}

		public Integer getViState() {
			return viState;
		}

		public void setViState(Integer viState) {
			this.viState = viState;
		}

		public String getAppiontPerson() {
			return appiontPerson;
		}

		public void setAppiontPerson(String appiontPerson) {
			this.appiontPerson = appiontPerson;
		}

		public ReportFormCenter getParent() {
			return parent;
		}

		public void setParent(ReportFormCenter parent) {
			this.parent = parent;
		}

		public Set<ReportFormCenter> getChilds() {
			return childs;
		}

		public void setChilds(Set<ReportFormCenter> childs) {
			this.childs = childs;
		}

		public Integer getId() {
			return id;
		}

		public void setId(Integer id) {
			this.id = id;
		}

		public String getName() {
			return name;
		}

		public void setName(String name) {
			this.name = name;
		}

		public String getRemark() {
			return remark;
		}

		public void setRemark(String remark) {
			this.remark = remark;
		}

		public String getUpdatePermission() {
			return updatePermission;
		}

		public void setUpdatePermission(String updatePermission) {
			this.updatePermission = updatePermission;
		}

		public String getVisitPermission() {
			return visitPermission;
		}

		public void setVisitPermission(String visitPermission) {
			this.visitPermission = visitPermission;
		}

		public String getUpdateSet() {
			return updateSet;
		}

		public void setUpdateSet(String updateSet) {
			this.updateSet = updateSet;
		}

		public String getUpdatePerson() {
			return updatePerson;
		}

		public void setUpdatePerson(String updatePerson) {
			this.updatePerson = updatePerson;
		}

		public String getJspPath() {
			return jspPath;
		}

		public void setJspPath(String jspPath) {
			this.jspPath = jspPath;
		}

		public Attachment getAttach() {
			return attach;
		}

		public void setAttach(Attachment attach) {
			this.attach = attach;
		}

		public Attachment getAttach1() {
			return attach1;
		}

		public void setAttach1(Attachment attach1) {
			this.attach1 = attach1;
		} 
		
	}
